<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <!-- <meta http-equiv="Cache-Control" content="public" /> -->
    <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
    <meta name="msapplication-tap-highlight" content="no" />
    <meta name="viewport"
        content="width=device-width, height=device-height, initial-scale=1, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <title>汽车在线</title>
    <link type="text/css" rel="stylesheet" href="css/global.css" />
    <style>
        .header .info-bar {
            position: absolute;
        }

        .header .title .toolbox {
            background-image: url(images/icon_menu.png);
        }

        #content-container,
        #map-container {
            width: 100%;
            height: 100%;
        }

        #content-container {
            position: relative;
            margin-top: 3.5em;
        }

        #cross-container {
            width: 100%;
            height: 100%;
            background-image: url(images/icon_cross.png);
            -webkit-background-size: contain;
            background-size: contain;
            background-position: center center;
            background-repeat: no-repeat;
            z-index: 9;
            position: absolute;
            top: 0;
            left: 0;
            pointer-events: none;
        }

        #original-btn {
            position: absolute;
            left: 20px;
            bottom: 90px;
            width: 3em;
            height: 3em;
            background-image: url(images/icon_car.png);
            -webkit-background-size: contain;
            background-size: contain;
            z-index: 10;
            cursor: pointer;
        }

        #content-container .toolbar {
            position: absolute;
            bottom: 0;
            left: 0;
            height: 70px;
            width: 100%;
            background-color: rgba(30, 30, 30, .8);
            z-index: 10;
            text-align: center;
        }

        #content-container .toolbar p {
            color: #fff;
            margin: 5px 0;
            padding: 0;
            font-size: .8em;
        }

        #content-container .toolbar input {
            margin: 0 20px;
        }

        #content-container .radius-slider {
            position: absolute;
            left: 50%;
            top: 10px;
            margin-left: -45%;
            width: 90%;
            height: 50px;
            background-color: rgba(255, 255, 255, .9);
            -webkit-border-radius: 50px;
            border-radius: 50px;
            border: 1px solid #ddd;
            z-index: 10;
        }

        #content-container .radius-slider .button {
            height: 40px;
            width: 40px;
            margin: 5px;
            background-color: #fff;
            -webkit-border-radius: 40px;
            border-radius: 40px;
            border: 1px solid #ddd;
            display: inline-block;
            font-size: 2em;
            text-align: center;
            line-height: 35px;
            color: #999;
            cursor: pointer;
        }

        #content-container .radius-slider .slider-wrapper {
            position: relative;
            margin: -30px 60px;
            cursor: pointer;
        }

        #content-container .radius-slider .slider-wrapper .line {
            height: 8px;
            background-color: #fff;
            -webkit-border-radius: 8px;
            border-radius: 8px;
            border: 1px solid #ddd;
        }

        #content-container .radius-slider .slider-wrapper .pass-line {
            height: 8px;
            background-color: #4E6BB9;
            -webkit-border-radius: 8px;
            border-radius: 8px;
            border: 1px solid #ddd;
            margin-top: -10px;
            position: relative;
            width: 0;
        }

        #content-container .radius-slider .slider-wrapper .block {
            width: 20px;
            height: 20px;
            position: absolute;
            top: -6px;
            left: 0;
            background-color: #fff;
            -webkit-border-radius: 12px;
            border-radius: 12px;
            border: 1px solid #ddd;
            z-index: 10;
        }

        #content-container .radius-slider .current-radius {
            margin: 50px auto;
            width: 10em;
            padding: 5px 0;
            z-index: 10;
            font-size: .8em;
            text-align: center;
            color: #fff;
            background-image: -webkit-linear-gradient(left, rgba(78, 107, 185, 0), rgba(78, 107, 185, 1), rgba(78, 107, 185, 0));
        }

        #phone-set-mask {
            background-color: rgba(0, 0, 0, .3);
            width: 100%;
            height: 100%;
            position: absolute;
            z-index: 999;
            top: 0;
            left: 0;
            display: none;
            font-size: .8em;
        }

        #phone-set-mask ul {
            width: 80%;
            margin: -125px auto;
            position: relative;
            top: 50%;
            background-color: #fff;
            border: 1px solid #ccc;
            padding-bottom: 10px;
        }

        #phone-set-mask ul li {
            padding: 10px 10px 0;
        }

        #phone-set-mask ul li.title {
            padding: 10px;
            font-size: 1.2em;
            background-color: #4E6BB9;
            color: #fff;
        }

        #phone-set-mask ul li #phone {
            -webkit-box-sizing: border-box;
            box-sizing: border-box;
        }
    </style>
    <script src="js/lang_cn.js"></script>
    <script src="js/brand/zepto.min.js"></script>
    <script src="js/global.js"></script>
</head>

<body>
    <div class="container">
        <div class="header">
            <h3 class="title">
                <a class="back" href="javascript:history.back();"></a><a class="toolbox" href="javascript:;"></a>电子围栏
            </h3>
        </div>
        <div id="content-container">
            <div id="map-container">
                <div class="loading">Loading...</div>
            </div>
            <div id="cross-container"></div>
            <div class="radius-slider">
                <div class="button" data-action="less">-</div>
                <div class="button pull-right" data-action="more">+</div>
                <div class="slider-wrapper">
                    <div class="line track"></div>
                    <div class="pass-line cover"></div>
                    <div class="block knob"></div>
                </div>
                <div class="current-radius">半径：<span id="current-radius">200</span>米</div>
            </div>
            <div id="original-btn"></div>
            <div class="toolbar">
                <p>拖动地图调整围栏中心，拖动进度条控制围栏范围大小</p>
                <input type="button" id="set-fence" class="normal-btn normal-btn-xs disabled" disabled="disabled"
                    value="设置围栏"><input type="button" class="normal-btn normal-btn-xs" id="switch-fence" value="开启围栏">
            </div>
        </div>
        <div id="phone-set-mask">
            <ul>
                <li class="title">短信提醒设置</li>
                <li>设备名称：<span id="device-name"></span></li>
                <li>手机号码：<input type="text" id="phone" value="" autocomplete="off"></li>
                <li>
                    <p class="color-red">1.号码为空时不接受短信提醒<br />2.短信费用从设备SIM卡上扣<br />3.设备会因为SIM卡欠费而离线</p>
                </li>
                <li><input type="button" data-action="confirm" class="normal-btn normal-btn-xs" value="确定"><input
                        type="button" class="normal-btn normal-btn-xs pull-right" data-action="cancel" value="取消"></li>
            </ul>
        </div>
    </div>
    <script>
        //电子围栏的也不易使用goome.maps.js适配，比如地图控件个性初始化，拖动围栏大小时地图zoom调整。
        //用goome.maps.js还要underscore.js，加载的js多。估计微信版的，功能逻辑变化很少，地图都不适配吧。
        var utils = goome.wx.utils;
        if (utils.defaultParams().map_type == 'GOOGLE') {
            utils.writeScripts(['http://ditu.google.cn/maps/api/js?sensor=false', 'js/fence-google.js']);
        } else {
            utils.writeScripts(['http://api.map.baidu.com/api?v=2.0&ak=BCa2d508d2c567acd009eb09765f5797', 'js/fence.js']);
        }
    </script>
    <script src="js/brand/slider.js"></script>
    <script type="text/javascript">
        fence.init();
    </script>
</body>

</html>